import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../layout/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: '/goods',
    children: [
      {
        path: '/list',
        component: () =>
          import(/* webpackChunkName: "Search" */ '../layout/Home/Index.vue'),
        redirect: '/goodslist',
        children: [
          {
            path: '/goodslist',
            component: () =>
              import(
                /* webpackChunkName: "Search" */ '../views/ShopsInfo/GoodsList.vue'
              )
          },
          {
            path: '/evaluate',
            component: () =>
              import(
                /* webpackChunkName: "Search" */ '../views/ShopsInfo/GoodsEvaluate.vue'
              )
          },
          {
            path: '/shop',
            component: () =>
              import(
                /* webpackChunkName: "Search" */ '../views/ShopsInfo/Goodshop.vue'
              )
          }
        ]
      },
      {
        path: '/goods',
        component: () =>
          import(/* webpackChunkName: "Search" */ '../layout/Home/Goods.vue')
      }
    ]
  },
  {
    path: '/search',
    component: () =>
      import(/* webpackChunkName: "Search" */ '../layout/Search/Search.vue')
  },
  {
    path: '/order',
    component: () =>
      import(/* webpackChunkName: "Order" */ '../layout/Order/Order.vue')
  },
  {
    path: '/mine',
    component: () =>
      import(/* webpackChunkName: "Mine" */ '../layout/Mine/Mine.vue')
  }
]
// component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
const router = new VueRouter({
  routes
})

export default router
